import 'dart:ffi';

import 'package:json_annotation/json_annotation.dart';

part 'Article.g.dart';

@JsonSerializable()
class Article {
  final int id;
  final int? originId;
  final String title;
  final int chapterId;
  final String chapterName;
  final String envelopePic;
  final String link;
  final String author;
  final String origin;
  final num publishTime;
  final int zan;
  final String desc;
  final int visible;
  final String niceDate;
  final String niceShareDate;
  final int courseId;
  final bool collect;
  final String apkLink;
  final String projectLink;
  final int superChapterId;
  final String? superChapterName;
  final int type;
  final bool fresh;
  final int audit;
  final String prefix;
  final int selfVisible;
  final num? shareDate;
  final String shareUser;
  final Object tags; // Not sure
  final int userId;

  Article(
      this.id,
      this.originId,
      this.title,
      this.chapterId,
      this.chapterName,
      this.envelopePic,
      this.link,
      this.author,
      this.origin,
      this.publishTime,
      this.zan,
      this.desc,
      this.visible,
      this.niceDate,
      this.niceShareDate,
      this.courseId,
      this.collect,
      this.apkLink,
      this.projectLink,
      this.superChapterId,
      this.superChapterName,
      this.type,
      this.fresh,
      this.audit,
      this.prefix,
      this.selfVisible,
      this.shareDate,
      this.shareUser,
      this.tags,
      this.userId);

  factory Article.fromJson(Map<String, dynamic> json) =>
      _$ArticleFromJson(json);

  Map<String, dynamic> toJson() => _$ArticleToJson(this);
}
